<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('电池列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>二维码编号：</label>
                                <input type="text" name="qrCode"/>
                            </li>
                            <li>
                                <label>电池编号mac：</label>
                                <input type="text" name="batMac"/>
                            </li>
                            <li>
                                <label>电池价格：</label>
                                <input type="text" name="batPrice"/>
                            </li>
                            <li>
                                <label>电池名称：</label>
                                <input type="text" name="batName"/>
                            </li>
                            <li>
                                <label>电池类型：</label>
                                <select name="batType">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>出售时间：</label>
                                <input type="text" class="time-input" placeholder="请选择出售时间" name="sellTime"/>
                            </li>
<!--                            <li>-->
<!--                                <label>质保类型，1，3个月 2，6个月 3，一年：</label>-->
<!--                                <select name="warrantyType">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option value="-1">代码生成请选择字典属性</option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li>
                                <label>质保到期时间：</label>
                                <input type="text" class="time-input" placeholder="请选择质保到期时间" name="warrantyTime"/>
                            </li>
                            <li>
                                <label>用户ID，门店店长的id：</label>
                                <input type="text" name="userId"/>
                            </li>
                            <li>
                                <label>部门ID，门店id：</label>
                                <input type="text" name="deptId"/>
                            </li>
                            <li>
                                <label>描述：</label>
                                <input type="text" name="batDesc"/>
                            </li>
                            <li>
                                <label>售出的客户姓名：</label>
                                <input type="text" name="customerName"/>
                            </li>
                            <li>
                                <label>售出的客户手机号码：</label>
                                <input type="text" name="customerMobile"/>
                            </li>
                            <li>
                                <label>售出的客户地址：</label>
                                <input type="text" name="customerAddr"/>
                            </li>
                            <li>
                                <label>售出的客户微信号：</label>
                                <input type="text" name="customerWx"/>
                            </li>
                            <li>
                                <label>电池状态：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="battery:batinfo:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="battery:batinfo:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="battery:batinfo:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="battery:batinfo:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('battery:batinfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('battery:batinfo:remove')}]];
        var prefix = ctx + "battery/batinfo";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "电池",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'qrCode',
                    title: '二维码编号'
                },
                {
                    field: 'batMac',
                    title: '电池编号mac'
                },
                {
                    field: 'batPrice',
                    title: '电池价格'
                },
                {
                    field: 'batName',
                    title: '电池名称'
                },
                {
                    field: 'batType',
                    title: '电池类型'
                },
                {
                    field: 'sellTime',
                    title: '出售时间'
                },
                {
                    field: 'warrantyType',
                    title: '质保类型，1，3个月 2，6个月 3，一年'
                },
                {
                    field: 'warrantyTime',
                    title: '质保到期时间'
                },
                {
                    field: 'userId',
                    title: '用户ID，门店店长的id'
                },
                {
                    field: 'deptId',
                    title: '部门ID，门店id'
                },
                {
                    field: 'batDesc',
                    title: '描述'
                },
                {
                    field: 'customerName',
                    title: '售出的客户姓名'
                },
                {
                    field: 'customerMobile',
                    title: '售出的客户手机号码'
                },
                {
                    field: 'customerAddr',
                    title: '售出的客户地址'
                },
                {
                    field: 'customerWx',
                    title: '售出的客户微信号'
                },
                {
                    field: 'status',
                    title: '电池状态'
                },
                {
                    field: 'createBy',
                    title: '创建者'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'updateBy',
                    title: '更新者'
                },
                {
                    field: 'updateTime',
                    title: '更新时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
